//
//  CustomExpressDetailTableViewCell.m
//  ChunLaiZhuangClient
//
//  Created by zouzhisheng on 16/4/28.
//  Copyright © 2016年 CLZ. All rights reserved.
//

#import "CustomExpressDetailTableViewCell.h"

@implementation CustomExpressDetailTableViewCell

+ (instancetype)cellWithTableView:(UITableView *)tableView{
    static NSString *identifier = @"status";
    // 1.缓存中取
    CustomExpressDetailTableViewCell*cell = [tableView dequeueReusableCellWithIdentifier:identifier];
    // 2.创建
    if (cell == nil) {
        cell = [[CustomExpressDetailTableViewCell alloc]initWithStyle:UITableViewCellStyleDefault reuseIdentifier:identifier];
        cell.selectionStyle=UITableViewCellSelectionStyleNone;
        [cell setSeparatorInset:UIEdgeInsetsMake(0, 0, 0, 0)];
        [cell setLayoutMargins:UIEdgeInsetsMake(0, 0, 0, 0)];
    }
    return cell;
}
-(id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _statusLabel=[[UILabel alloc] initWithFrame:CGRectMake(20, 15, SCREEN_WIDTH-40, 0)];
        _statusLabel.font=[UIFont systemFontOfSize:14];
        _statusLabel.textColor=[UIColor colorWithHexString:@"000000"];
        _statusLabel.numberOfLines=0;
        _dataLabel=[[UILabel alloc] initWithFrame:CGRectMake(20, 0, SCREEN_WIDTH-100, 20)];
        _dataLabel.font=[UIFont systemFontOfSize:12];
        _dataLabel.textColor=[UIColor colorWithHexString:@"969696"];
        [self addSubview:_statusLabel];
        [self addSubview:_dataLabel];
    }
    return self;
}

-(void)setFrameModel:(ExpressFrameModel *)frameModel{
    _statusLabel.text=frameModel.expressModel.status;
    _dataLabel.text=frameModel.expressModel.date_added;
    _statusLabel.height=frameModel.labelHeigh;
    _dataLabel.top=_statusLabel.bottom+3;
}
- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
